
<template>
  <div class="vuelayout-index-wrapper">
      <header class="vuelayout-header">
          <div class="layout-logo">
          </div>
          <ul class="links-list">
              <router-link class="links-item" :class="$route.path == item.to ? 'active' : '' "  tag="li" v-for="item in links" :key="item.to"  :to="item.to" >{{item.name}}</router-link>   
          </ul>
      </header>
      <div class="vuelayout-container">
          <router-view></router-view>
      </div>
  </div>
</template>

<script>
export default {
  name: 'Index',
    data(){
        return {
            msg: '我是标题',
            links: [
                {
                    name: '组件维护',
                    to: '/home/tag'
                },
                {
                    name: '通用数据源',
                    to: '/home/data'
                },
                {
                    name: '布局维护',
                    to: '/home/layout'
                }
            ]
        }
    },
    watch: {
    }
}
</script>

<style>
  .vuelayout-index-wrapper {
      height: 100%;  
    }
    .vuelayout-header {
        display: flex;
        height: 50px;
        background-color: #32bdd6
    }

    .layout-logo {
        width: 120px;
        flex-shrink: 0;
        margin-right: 80px;
    }

    /*.layout-logo > img {*/
    /*    !*width: 100%;*!*/
    /*    !*height: 100%;*!*/
    /*}*/

    .links-list {
        width: calc(100% - 200px);
        flex-shrink: 0;
    }

    .links-item {
        display: inline-block;
        text-align: center;
        cursor: pointer;   
        height: 50px;
        width: 100px;
        margin-left: 5px;
        color: #fff;
        line-height: 50px;
        position: relative;
    }

    .links-item.active {
        height: 56px;
        background-color: #396e79;
        z-index: 1;
    }

    .links-item.active::before {
        border-color: #234249 transparent transparent;
        border-style: solid;
        border-width: 6px 0 0 10px;
        bottom: 0;
        content: "";
        display: block;
        position: absolute;
        left: -10px;
    }

    .links-item.active::after {
        border-color: #234249 transparent transparent;
        border-style: solid;
        border-width: 6px 10px 0 0;
        bottom: 0;
        content: "";
        display: block;
        position: absolute;
        right: -10px;
    }

    .vuelayout-container {
        height: calc(100% - 50px);
    }

    /* 公共样式 */
    .common-main {
        display: flex;
        height: 100%;
    }

    .common-aside {
        width: 270px;
        border-right: 6px solid #888;
        box-sizing: border-box;
        flex-shrink: 0;
        background-color: #efefef;
        position: relative;
    }


    .common-section {
        width:calc(100% - 270px);
        box-sizing: border-box;
        flex-shrink: 0;
    }

    .top-tools {
        height: 40px;
        background-color: #fff;
        display: flex;
        justify-content: center;
        align-items: center;
        padding-top: 20px;
    }
    
    .icon-tools {
        display: inline-block;
        height: 24px;
        line-height: 24px;
        color: #fff;
        text-align: center;
        padding: 0 10px;
        border-radius: 4px;
        background-color: orange;
        cursor: pointer;
        margin: 0 6px;
    }

    .tree-box {
        height: calc(100% - 100px);
        border-bottom: 2px solid #666;
        overflow: auto;
    }

    .add-btn {
        position: absolute;
        background: none;
        background-color: #eb6638;
        border-radius: 3px;
        color: #fff;
        padding: 0 10px;
        width: 160px;
        box-sizing: border-box;
        line-height: 32px;
        height: 32px;
        text-align: center;
        left: 50%;
        transform: translateX(-50%);
        bottom: 20px;
        cursor: pointer;
    }

    .add-btn .icon-add {
        display: inline-block;
        vertical-align: middle;
        width: 14px;
        height: 14px;
        background: url('/com.leadal.saloon.vuelayout/image/add.png');
        background-size: 100% 100%;
    }

    .common-section-header {
        height: 50px;
        background-color: #B3D9D9;
        padding: 0 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .common-section-header > * {
        flex-shrink: 0;
    }

    .search-wrapper {
        width: 250px;
        flex-shrink: 0;
        display: flex;
        justify-content: flex-start;
    }

    .search-input {
        width: 180px;
        border: none;
        outline: none;
        border: 1px solid #ccc;
        border-radius: 4px 0 0 4px;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .common-section-container {
        height: calc(100% - 52px);
    }

    .c-s-container-top {
        height: calc(100% - 40px);
    }

    .c-s-container-footer {
        height: 40px;
        line-height: 40px;
        background-color: #dfdfdf;
        display: flex;
        justify-content: flex-end;
    }
</style>